<!DOCTYPE html>
<html>
  <head>
  	<div th:include="base-libs :: base-libs" />
  	<link th:href="@{/service/css/xymb.css}" rel="stylesheet"/>
    <title>查看协议</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <style>
    	body{
    		overflow:auto;
    	}
    	#btnBox{
    		text-align:center;
    		height:40px;
    		line-height:40px;
    		border:0;
    		overflow:hidden;
    		background:#f9f9f9;
    	}
    	.panel,.panel-header,.panel-body{
    		width:100% !important;
    	}
    </style>
    <script>
   	 	var ckxyData = StoreCache.removeCache("ckxyData");
    	$(function(){
    		initView();
    	})
    	
    	function initView(){
    		$.QuickRemote.AjaxJson( contextRoot + "xymb/queryXymb", function(result){
                var content = result["CONTENT"];
                $("#center").append(content);
                $("textarea").prop("readonly","readonly");
                $("#jfTable,#yfTable").parent().parent().css('display','block');
                /** 加载甲乙双方信息  */
                initData();
                
                deleteTag();
            }, {XYMBID: ckxyData.XYID});
    		
    		//返回按钮
    		$("#btnBack").click(function(){
    			$.QuickUrlUtils.redirectUrl("index.html");
    		})
    	}
    	
    	function initData(){
    		//ZDYLJGID | YLJGID
    		var YLJGIDArr = [ckxyData.ZDYLJGID, ckxyData.YLJGID];
    		
    		$.QuickRemote.AjaxJson(contextRoot + "yljgxx/queryList.service", queryDataBack, {YLJGIDS: YLJGIDArr.join()});
    	}
    	
    	/** 查询医疗机构信息  回调 */
    	function queryDataBack(resultArr){
    		$.each(resultArr, function(i,item){
    			var PTJGID = item.PTJGID;
    			if(PTJGID == ckxyData.ZDYLJGID){
    				$("#jfTable span").each(function(){
    					var key = $(this).attr('name');
    					$(this).html(item[key]);
    				})
    			}else{
    				$("#yfTable span").each(function(){
    					var key = $(this).attr('name');
    					$(this).html(item[key]);
    				})
    			}
    		})
    	}
    	
    	/** 删除多余节点 */
    	function deleteTag(){
    		//删除服务项列表的操作列
    		$("#tabFwx tr").each(function(){
    			$(this).children().last().remove();
    		})
    		
    		//删除管理服务项按钮
    		$(".panel-tool").remove();
    	}
    </script>

  </head>
  
  <body class="easyui-layout">
    	<div region="center" id="center"></div>
    	<div region="south" id="btnBox">
    		<button id="btnBack" type="button">返回</button>
    	</div>
  </body>
</html>
